<?php 
require_once('../kelas/amankanParam.php');
require_once('../kelas/fungsi.php');
require_once('../kelas/record.php');
require_once('../kelas/useradmin.php');
require_once('../kelas/pemesanan.php');
require_once('../kelas/kategori.php');
require_once('../kelas/produk.php');
$dtPost = $objParamAman->postMethod();
$dtGet = $objParamAman->getMethod();
echo $objFungsi->buatJudul('Daftar Pesanan');
$status = isset($dtGet['status'])?$dtGet['status']:"";
$dtPesanan = $objPemesanan->getListOrder(null,null,$status);
 ?>

<div class="frame_table_order">
<table width="100%" cellpadding="5" cellspacing="0" border="1" style="border-collapse:collapse">

    <thead>
        <tr align="center" valign="middle" bgcolor="#CCCCCC">
        			<th>Tanggal</th>
			<th>No Pesananan</th>
			<th>Status Pesanan</th>
			<th>Pesan Tambahan</th>
			<th>Pilihan</th>
		</tr>
	</thead>
	<?php 
	if($dtPesanan['total']>0){
	foreach ($dtPesanan['result'] as $key => $value) {
		?>
		<tr>
			<td><?php echo $objFungsi->tanggal1($value['tanggal']); ?></td>
			<td><?php echo $value['id_pemesanan']; ?></td>
			<td><?php echo $objPemesanan->statusOrder($value['status_pesan']); ?></td>
			<td><?php echo $objFungsi->potongKalimat($value['pesan_tambahan']); ?></td>
			<td><a href="<?php echo BASEURLADMIN ?>?v=transaksi&p=prosesorder&idorder=<?php echo $value['id_pemesanan'] ?>">Detail</a></td>
		</tr>
		<?php
	}
}
else{
	?>
	<tr>
<td>(tidak ada pesanan)</td>
	</tr>
	<?php
}
	 ?>
</table>
</div>